<?php

namespace App\Models\Entity\Column;

use Illuminate\Database\Eloquent\Model;

// use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Album
 * @package App\Models\Entity\Column
 * @version August 1, 2017, 4:32 pm UTC
 */
class RecommendData extends Model
{
    // use SoftDeletes;
    // $table->integer('recommend_id')->unsigned()->default(0)->comment('推荐位ID');
    // $table->string('name')->comment('推荐位名称');
    // $table->string('title')->nullable()->comment('标题');
    // $table->string('subtitle')->nullable()->comment('副标题');
    public $table = 'recommend_datas';

    // protected $dates = ['deleted_at'];

    public $fillable = [
        'recommend_id',
        'name',
        'title',
        'subtitle',
        'href',
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'recommend_id' => 'integer',
        'name'         => 'string',
        'title'        => 'string',
        'subtitle'     => 'string',
        'href'         => 'string',
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function recommend()
    {
        return $this->hasOne(\App\Models\Entity\Column\Recommend::class, 'id', 'recommend_id');
    }
}
